package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.BusiDeptWorkhour;
import com.ruoyi.system.domain.BusiUserWorkhour;
import com.ruoyi.system.domain.WorkHourAndPerson;
import com.ruoyi.system.mapper.BusiUserWorkhourMapper;
import com.ruoyi.system.service.BusiUserWorkhourService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusiUserWorkhourServiceImpl implements BusiUserWorkhourService {
    @Autowired
    BusiUserWorkhourMapper busiUserWorkhourMapper;

    /**
     * 年初初始化工时
     */
    public int addBusiUserWorkhour(BusiUserWorkhour busiUserWorkhour) {
        return busiUserWorkhourMapper.insert(busiUserWorkhour);
    }

    @Override
    public List<WorkHourAndPerson> showAllBusiUserWorkhour() {
        return busiUserWorkhourMapper.showAll();
    }

    @Override
    public List<BusiUserWorkhour> selectByName(String name) {
        return busiUserWorkhourMapper.selectByName(name);
    }

    @Override
    public BusiUserWorkhour selectById(String id) {
        return busiUserWorkhourMapper.selectById(id);
    }

    @Override
    public List<WorkHourAndPerson> find(String targetMonth, String personGroup, String personName) {
        return busiUserWorkhourMapper.find(targetMonth,personGroup,personName);
    }

    @Override
    public int update(BusiUserWorkhour busiUserWorkhour) {
        return busiUserWorkhourMapper.updateByPrimaryKeySelective(busiUserWorkhour);
    }

    @Override
    public List<BusiDeptWorkhour> getBusiDeptWorkhour() {
        return busiUserWorkhourMapper.getDeptWorkHour();
    }

    @Override
    public BusiUserWorkhour findByNameMonth(String name, String month) {

        return busiUserWorkhourMapper.findByNameMonth(name,month);
    }


}
